package cn.iocoder.an.module.mold.dal.mysql.upkeepitem;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.upkeepitem.UpkeepItemDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.upkeepitem.vo.*;

/**
 * 模具保养项目 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface UpkeepItemMapper extends BaseMapperX<UpkeepItemDO> {

    default PageResult<UpkeepItemDO> selectPage(UpkeepItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UpkeepItemDO>()
                .likeIfPresent(UpkeepItemDO::getName, reqVO.getName())
                .likeIfPresent(UpkeepItemDO::getCode, reqVO.getCode())
                .betweenIfPresent(UpkeepItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UpkeepItemDO::getId));
    }

}